package com.flying.invest.strategy.model;

import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.ServiceField;
import com.flying.framework.annotation.ServiceFieldParam;
import com.flying.invest.invest.model.Investment;

@SuppressWarnings("serial")
public class StrategyGridDetailExt extends StrategyGridDetail{

	@ServiceField(serviceId="InvestmentService:findById", params={@ServiceFieldParam(param=Investment.INVEST_ID, value="$"+INVEST_ID)})
	@Param(value="invest",   required=false,	desc="投资", ignored=true)
	private Investment invest;

	@ServiceField(serviceId="StrategyService:findById", params={@ServiceFieldParam(param=Strategy.STRATEGY_ID, value="$"+STRATEGY_ID)})
	@Param(value="strategy",   required=false,	desc="策略", ignored=true)
	private Strategy strategy;
	
	public Investment getInvest() {
		return invest;
	}

	public Strategy getStrategy() {
		return strategy;
	}

	public String getInvestName() {
		var invest = this.getInvest();
		return invest == null? null: invest.getName();
	}
	
	public Integer getInvestStatus() {
		var invest = this.getInvest();
		return invest == null? null: invest.getStatus();
	}

	public Double getPrice() {
		var invest = this.getInvest();
		return invest == null? null: invest.getPrice();
	}
	
	public String getStrategyType() {
		var strategy = this.getStrategy();
		return strategy == null?null: strategy.getStrategyTypeName();
	}
	
	public Integer getStrategyStatus() {
		var strategy = this.getStrategy();
		return strategy == null?null: strategy.getStatus();
	}
}
